/*

* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Smart-Shop开源商城系统/ Java商城-首选电商平台系统 请务必保留此注释头信息
* |     开源地址: https://gitee.com/ningbo-qishan/gruul-mall
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     可正常分享和学习源码,未经授权 不可商用！
* |     商业版中台购买/开源版商业授权 联系技术客服
* |     官网:  https://www.73app.cn/
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Copyright (c) 2016-2999 宁波启山智软科技有限公司
* |     版权所有 ,侵权必究！
* ------------------------------------------------------------------------

*/
package com.medusa.gruul.discount.api.model.dto.manager;

import cn.hutool.core.bean.BeanUtil;
import com.medusa.gruul.discount.api.entity.FullScale;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *
 * 满减活动
 *
 * @author lcysike
 * @since 2019-12-09
 */
@Data
@ApiModel(value = "新增或修改满减活动信息DTO")
public class FullScaleDto implements Serializable {

    private Long id;

    @ApiModelProperty(value = "活动名称")
    @NotBlank(message = "活动名称不能为空")
    private String name;

    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "适用商品类型：  0-全部商品参与  1-指定商品参与  2-指定商品不参与")
    @NotNull(message = "适用商品类型不能为空")
    private Integer productType;

    @ApiModelProperty(value = "可用抵扣： 0-积分")
    private String deductionType;

    @ApiModelProperty(value = "适用优惠：0-会员价  1-优惠劵 (多个用逗号隔开)")
    private String applyType;

    @ApiModelProperty(value = "活动状态：  0-未开始  1-进行中  2-已结束")
    private Integer status;

    @ApiModelProperty(value = "满减活动关联商品信息")
    private List<FullScaleProductDto> fullScaleProducts;


    @ApiModelProperty(value = "满减活动规则信息")
    private List<FullScaleRuleDto> fullScaleRules;

    public FullScale coverFullScale() {
        FullScale fullScale = new FullScale();
        BeanUtil.copyProperties(this, fullScale);
        return fullScale;
    }
}
